# -*- coding: utf-8 -*-
# @File  : 读写文件.py
# @Author: zbh
# @Date  : 2025/2/14_15:50

def read_file(filename):
    """
    读取文件
    :param filename: 文件名
    :return: 列表
    """
    with open(filename, 'r', encoding='utf-8') as f:
        return f.readlines()
print(read_file("test.txt"))


def write_file(filename):
    """
    写入文件
    :param filename: 文件名
    :param content: 内容
    :return: None
    """
    with open(filename, 'a', encoding='utf-8') as f:
        f.write("\n通过python写入txt内容")

write_file("test.txt")




















